package org.exhaust.barbecue.test.action;

import org.exhaust.barbecue.AbstractRequest;
import org.exhaust.barbecue.AbstractResponse;
import org.exhaust.barbecue.ActionContext;
import org.exhaust.barbecue.action.AbstractServiceAction;
import org.exhaust.barbecue.test.model.AddUserRequest;
import org.exhaust.barbecue.test.model.AddUserResponse;
import org.exhaust.barbecue.test.util.Context;
import org.springframework.stereotype.Component;

@Component("AddUserDBHandleAction")
public class AddUserDBHandleAction extends AbstractServiceAction<AddUserRequest, AddUserResponse> {
    @Override
//    @Transactional
    public boolean perform(AbstractRequest request, AbstractResponse response, ActionContext context) {
        return super.perform(request, response, context);
    }

    @Override
    protected boolean service(AddUserRequest request, AddUserResponse response, ActionContext context) {
        //DO INSERT
        String uid = (String) context.getValue(Context.UID);
        System.out.println(uid);
        response.setData(uid);
        return true;
    }
}
